/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.goldentrade.negocio.beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Andre
 */
@Entity
@Table(name = "estrategia_operacao")
@NamedQueries({
    @NamedQuery(name = "EstrategiaOperacao.findAll", query = "SELECT e FROM EstrategiaOperacao e"),
    @NamedQuery(name = "EstrategiaOperacao.findByCdEstrategia", query = "SELECT e FROM EstrategiaOperacao e WHERE e.cdEstrategia = :cdEstrategia"),
    @NamedQuery(name = "EstrategiaOperacao.findByDcEstrategia", query = "SELECT e FROM EstrategiaOperacao e WHERE e.dcEstrategia = :dcEstrategia"),
    @NamedQuery(name = "EstrategiaOperacao.findByVlTxNegociacao", query = "SELECT e FROM EstrategiaOperacao e WHERE e.vlTxNegociacao = :vlTxNegociacao")})
public class EstrategiaOperacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name = "cd_estrategia")
    private Integer cdEstrategia;
    @Column(name = "dc_estrategia")
    private String dcEstrategia;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "vl_tx_negociacao")
    private Float vlTxNegociacao;
    @JoinColumn(name = "cd_corretora", referencedColumnName = "cd_corretora")
    @ManyToOne
    private Corretora cdCorretora;

    public EstrategiaOperacao() {
    }

    public EstrategiaOperacao(Integer cdEstrategia) {
        this.cdEstrategia = cdEstrategia;
    }

    public Integer getCdEstrategia() {
        return cdEstrategia;
    }

    public void setCdEstrategia(Integer cdEstrategia) {
        this.cdEstrategia = cdEstrategia;
    }

    public String getDcEstrategia() {
        return dcEstrategia;
    }

    public void setDcEstrategia(String dcEstrategia) {
        this.dcEstrategia = dcEstrategia;
    }

    public Float getVlTxNegociacao() {
        return vlTxNegociacao;
    }

    public void setVlTxNegociacao(Float vlTxNegociacao) {
        this.vlTxNegociacao = vlTxNegociacao;
    }

    public Corretora getCdCorretora() {
        return cdCorretora;
    }

    public void setCdCorretora(Corretora cdCorretora) {
        this.cdCorretora = cdCorretora;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdEstrategia != null ? cdEstrategia.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstrategiaOperacao)) {
            return false;
        }
        EstrategiaOperacao other = (EstrategiaOperacao) object;
        if ((this.cdEstrategia == null && other.cdEstrategia != null) || (this.cdEstrategia != null && !this.cdEstrategia.equals(other.cdEstrategia))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.goldentrade.negocio.EstrategiaOperacao[ cdEstrategia=" + cdEstrategia + " ]";
    }
    
}
